<script>
import DefaultEntity from '@/template/entityTemp/defaultEntity.vue'
import DefaultQueryContent from '@/portal4.1/pc/component/query/container/DefaultQueryContent.vue'
export default {
  name: 'Query',
  components: { DefaultEntity, DefaultQueryContent },
  data() {
    return {
      type: 'default'
    }
  },
  computed: {
    theme() {
      return this.$store.getters.theme
    }
  },
  watch: {
    theme: {
      handler(newVal, oldVal) {
        const app = document.querySelector('body')
        if (undefined !== newVal) {
          app.classList.add('theme-' + newVal + '-content')
        }
        if (undefined !== oldVal) {
          app.classList.remove('theme-' + oldVal + '-content')
        }
      },
      deep: true
    }
  },
  created() {
    const app = document.querySelector('body')
    const theme = this.$store.getters.theme === undefined ? 'default' : this.$store.getters.theme
    app.classList.add('theme-' + theme + '-content')
  }
}
</script>
<template>
  <div>
    <default-query-content v-if="type === 'default'" />
    <default-entity />
  </div>
</template>
